package com.example.designpatterns.creational.abstractfactory;

import com.example.designpatterns.creational.abstractfactory.factory.CocaColaFactory;
import com.example.designpatterns.creational.abstractfactory.factory.ColaFactory;
import com.example.designpatterns.creational.abstractfactory.factory.PesiColaFactory;
import com.example.designpatterns.creational.abstractfactory.product.Bottle;
import com.example.designpatterns.creational.abstractfactory.product.Cola;

/**
 * 客户端代码（具体使用）
 *
 * @author scott
 */
public class Client {

    public static void main(String[] args) {
        // 使用可口可乐主题工厂，创建可口可乐系列的产品
        ColaFactory cocaColaFactory = new CocaColaFactory();
        Cola cocaCola = cocaColaFactory.createCola();
        Bottle cocaBottle = cocaColaFactory.createBottle();

        // 使用百事可乐主题工厂，创建百事可乐系列的产品
        ColaFactory pesiColaFactory = new PesiColaFactory();
        Cola pesiCola = pesiColaFactory.createCola();
        Bottle pesiColaBottle = pesiColaFactory.createBottle();
    }

}
